package org.rcy.ruicingmarket.controller;

import org.rcy.framework.api.entity.ResultMessage;
import org.rcy.ruicingmarket.goods.GoodsClient;
import org.rcy.ruicingmarket.goods.GoodsPageQueryRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;

/**
 * @author 吴康桥
 * @Description
 * @date 2022/9/2 17:01
 */

@RestController
@RequestMapping("/oss/goods")
public class OssGoodsController {

	protected final Logger logger = LoggerFactory.getLogger(getClass());

	@Autowired
	private GoodsClient goodsClient;

	public ResultMessage pageQuery(@RequestBody GoodsPageQueryRequest request) {
		try {
			return goodsClient.pageQuery(request);
		}catch (Exception e){
			logger.error(e.getMessage(),e);
			return ResultMessage.error();
		}
	}
}
